let questionListArr = [
  {
    id: 1,
    serialNumber: 1,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "未使用",
  },
  {
    id: 2,
    serialNumber: 2,
    testQuestionStem: "2021年语文期末测试试卷",
    testQuestionType: "随机试题",
    difficulty: "中级",
    status: "已使用",
  },
  {
    id: 3,
    serialNumber: 3,
    testQuestionStem: "2021年数学月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "使用中",
  },
  {
    id: 4,
    serialNumber: 4,
    testQuestionStem: "2022年语文期末测试试卷",
    testQuestionType: "随机试题",
    difficulty: "中级",
    status: "已使用",
  },
  {
    id: 5,
    serialNumber: 5,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "未使用",
  },
  {
    id: 6,
    serialNumber: 6,
    testQuestionStem: "2022年数学月考试卷",
    testQuestionType: "随机试题",
    difficulty: "高级",
    status: "使用中",
  },
  {
    id: 7,
    serialNumber: 7,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "中级",
    status: "未使用",
  },
  {
    id: 8,
    serialNumber: 8,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "已使用",
  },
  {
    id: 9,
    serialNumber: 9,
    testQuestionStem: "2022年数学期末测试试卷",
    testQuestionType: "随机试题",
    difficulty: "中级",
    status: "未使用",
  },
  {
    id: 10,
    serialNumber: 10,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "随机试题",
    difficulty: "高级",
    status: "已使用",
  },
  {
    id: 11,
    serialNumber: 11,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "中级",
    status: "使用中",
  },
  {
    id: 12,
    serialNumber: 12,
    testQuestionStem: "2022年数学期末测试试卷",
    testQuestionType: "固定试题",
    difficulty: "高级",
    status: "未使用",
  },
  {
    id: 13,
    serialNumber: 13,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "高级",
    status: "使用中",
  },
  {
    id: 14,
    serialNumber: 14,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "随机试题",
    difficulty: "中级",
    status: "已使用",
  },
  {
    id: 15,
    serialNumber: 15,
    testQuestionStem: "2021年数学月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "未使用",
  },
  {
    id: 16,
    serialNumber: 16,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "高级",
    status: "已使用",
  },
  {
    id: 17,
    serialNumber: 17,
    testQuestionStem: "2021年语文月考试卷",
    testQuestionType: "固定试题",
    difficulty: "初级",
    status: "已使用",
  },
  {
    id: 18,
    serialNumber: 18,
    testQuestionStem: "2021年数学月考试卷",
    testQuestionType: "固定试题",
    difficulty: "中级",
    status: "未使用",
  },
];
let id = questionListArr.length;
let oTbody = document.querySelector("tbody");
let oTzdiv = document.querySelector(".tz-page-div");
let delBtn = document.querySelector(".del-btn");
let searchBtn = document.querySelector(".search-btn");
let searchCon1 = document.querySelector(".search-con1");
let searchCon2 = document.querySelector(".search-con2");
let searchCon3 = document.querySelector(".search-con3");

let addBtn = document.querySelector(".add-btn");
let addSerialNumber = document.querySelector(".add-serialNumber");
let addPoolName = document.querySelector(".add-poolName");
let addClassificationHierarchy = document.querySelector(
  ".add-classificationHierarchy"
);
let addSortTheValue = document.querySelector(".add-sortTheValue");
let addCreatedBy = document.querySelector(".add-createdBy");
let editBtn = document.querySelector(".edit-btn");
let editSerialNumber = document.querySelector(".edit-serialNumber");
let editPoolName = document.querySelector(".edit-poolName");
let editClassificationHierarchy = document.querySelector(
  ".edit-classificationHierarchy"
);
let editSortTheValue = document.querySelector(".edit-sortTheValue");
let editCreatedBy = document.querySelector(".edit-createdBy");
let cheksBox = document.querySelector(".cheks-box");
let emptyBtn = document.querySelector(".empty-btn");
let oInquire3 = document.querySelector("#Inquire3");
let cheBox = document.getElementsByName("che-box");
// let n = questionArr.length - 1;
let count = 5; //每页的个数
let count2 = 4; //每页的个数
let count3 = 3; //每页的个数
let iNow = 1; //当前页数
let show; //显示页面
let i = document.querySelector("i");
let jump = document.querySelector(".jump");
let pageSres = document.querySelector("#pagesres");
let delId = 0;
let editId = 0;
function render(iNow, num, arr) {
  //判断每页条数
  if (show == count) {
    num = count;
  } else if (show == count2) {
    num = count2;
  } else if (show == count3) {
    num = count3;
  } else {
    num = count;
  }

  //创建内容
  let str = "";
  let renderData = arr.slice((iNow - 1) * num, iNow * num);
  for (let i = 0; i < renderData.length; i++) {
    switch (renderData[i].status) {
      case "未使用":
        tzpaperdifficulty = 'class="tzpaperdifficultytype1"';
        break;
      case "已使用":
        tzpaperdifficulty = 'class="tzpaperdifficultytype2"';
        break;
      case "使用中":
        tzpaperdifficulty = 'class="tzpaperdifficultytype3"';
        break;
        default:
            tzpaperdifficulty=''
    }
    str += `<tr>
                                    <td>${renderData[i].serialNumber}</td>
                                    <td>${renderData[i].testQuestionStem}</td>
                                    <td>${renderData[i].testQuestionType}</td>
                                    <td>${renderData[i].difficulty}</td>
                                    <td ${tzpaperdifficulty}>${renderData[i].status}</td>
                                    <td data-id="${renderData[i].id}">
                                    <button data-toggle="modal" data-target="#delModal" class="btn btn-danger del">删除</button>
                                    <button class="btn btn-warning edit" data-toggle="modal" data-target="#editModal">修改</button>
                                    <button class="btn btn-warning edit" data-toggle="modal" data-target="#editModal">详情</button>
                                    </td>
                              </tr>
        `;
  }
  oTbody.innerHTML = str;
  //创建页码
  let pagesLeft = `<button class="left"><span class="glyphicon glyphicon-menu-left left" aria-hidden="true"></span></button>`;
  let pagesRight = `<button class="right"><span class="glyphicon glyphicon-menu-right right" aria-hidden="true"></span></button>`;
  //创建每页多少条
  var pagesres = ``;
  //如果点击的是页码，在让当前页码显示
  let pagesStr = "";
  for (let i = 1; i <= Math.ceil(arr.length / num); i++) {
    if (iNow == i) {
      pagesStr += `<button class="active-s yeam">${i}</button>`;
    } else {
      pagesStr += `<button class="yeam">${i}</button>`;
    }
  }
  oTzdiv.innerHTML = pagesLeft + pagesStr + pagesRight;
}

//页面加载就渲染
render(iNow, show, questionListArr);

//分页功能
oTzdiv.addEventListener("click", function (e) {
  if (e.target.className.includes("left")) {
    //左

    if (iNow > 1) {
      iNow--;
      render(iNow, show, questionListArr);
    }
  } else if (e.target.className.includes("right")) {
    //右
    if (iNow < Math.ceil(questionListArr.length / count)) {
      iNow++;
      render(iNow, show, questionListArr);
    }
  } else if (e.target.className.includes("yeam")) {
    //数字键
    console.log("dain");
    iNow = e.target.innerText.trim();
    render(iNow, show, questionListArr);
  }
});
//跳转的功能
function JumpPage() {
  let pages = Math.ceil(questionListArr.length / count);
  if (1 <= jump.value && jump.value <= pages) {
    render(jump.value, show, questionListArr);
  }
}
i.addEventListener("click", JumpPage);
jump.addEventListener("keyup", JumpPage);
//增加页数显示条件改变的功能
function changepage() {
  let src = pageSres.value;
  switch (src) {
    case "5":
      show = count;
      render(iNow, show, questionListArr);
      break;
    case "4":
      show = count2;
      render(iNow, show, questionListArr);
      break;
    case "3":
      show = count3;
      render(iNow, show, questionListArr);
      break;
  }
}

//所有的删除添加事件
oTbody.addEventListener("click", function (e) {
  //删除
  if (e.target.className.includes("del")) {
    delId = e.target.parentNode.dataset.id;
  } else if (e.target.className.includes("edit")) {
    //显示编辑框，赋值
    editSerialNumber.value =
      e.target.parentNode.parentNode.children[1].innerText;
      console.log(editSerialNumber.value);
    editPoolName.value = e.target.parentNode.parentNode.children[2].innerText;
    let str = e.target.parentNode.parentNode.children[3].innerText;
    document.querySelector(
      ".edit-classificationHierarchy option[value = " + str + "]"
    ).selected = true;
    str = e.target.parentNode.parentNode.children[4].innerText;
    document.querySelector(
      ".edit-sortTheValue option[value = " + str + "]"
    ).selected = true;
    str = e.target.parentNode.parentNode.children[5].innerText;
    document.querySelector(
      ".edit-createdBy option[value = " + str + "]"
    ).selected = true;
    editId = e.target.parentNode.dataset.id;
  }
});

// //点删除确定的时候
delBtn.addEventListener("click", function () {
  for (let i = 0; i < questionListArr.length; i++)
    if (questionListArr[i].id == delId) {
      questionListArr.splice(i, 1);

      let renderData = questionListArr.slice((iNow - 1) * count, iNow * count);
      if (renderData.length == 0 && iNow > 1) {
        iNow--;
      }
      searchCon1.value = "";
      searchCon2.value = "";
      searchCon3.value = "";
      render(iNow, show, questionListArr);
      return;
    }
});

// //跳转页面事件
pageSres.addEventListener("click", changepage);
//搜索按钮
searchBtn.addEventListener("click", function () {
    papermanagesreachall();
});

//点击添加的时候
addBtn.addEventListener("click", function () {
  questionListArr.push({
    id: editId,
    serialNumber: editSerialNumber.value,
    testQuestionStem: editPoolName.value,
    testQuestionType: editClassificationHierarchy.value,
    difficulty: editSortTheValue.value,
    status: editCreatedBy.value,
  });
  render(iNow, show, questionListArr);
});

//点击修改的时候
editBtn.addEventListener("click", function () {
  console.log(1);

  let json = {
    id: editId,
    serialNumber: editSerialNumber.value,
    testQuestionStem: editPoolName.value,
    testQuestionType: editClassificationHierarchy.value,
    difficulty: editSortTheValue.value,
    status: editCreatedBy.value,
  };
  for (let i = 0; i < questionListArr.length; i++) {
    if (questionListArr[i].id == editId) {
      questionListArr.splice(i, 1, json);
    }
  }
  render(iNow, show, questionListArr);
  console.log(json);
});

//清空按钮
emptyBtn.addEventListener("click", function () {
    window.history.go(0);
});

function papermanagesreachall(){
    let arr99=[];
    if (
      searchCon1.value == "" &&
      searchCon2.value == "" &&
      searchCon3.value == ""
    ){
        return;
    }
    for(let i=0;i<questionListArr.length;i++){
        if(questionListArr[i].testQuestionStem.includes(searchCon1.value) && questionListArr[i].testQuestionType.includes(searchCon2.value) && questionListArr[i].status.includes(searchCon3.value)){
            arr99.push(questionListArr[i]);
        }
    }
    render(iNow, show, arr99);
}


// -------------------左边下拉框-----------------------------------------------------------------------------
//  左边js
let tzpapermanageleft = document.querySelector(".papermanageleft");
let tzpapermanagewait = "";
let tzstr4all = "";
tzpapermanageleft.addEventListener("click", function () {
  if (event.target.className.includes("papermanagefirstorder")) {
    if (event.target.nodeName == "UL") {
      if (event.target.children[0].className.includes("glyphicon-plus-sign")) {
        event.target.children[0].classList.remove("glyphicon-plus-sign");
        event.target.children[0].classList.add("glyphicon-minus-sign");
        for (let i = 4; i < event.target.children.length; i++) {
          event.target.children[i].style.display = "block";
        }
      } else {
        event.target.children[0].classList.remove("glyphicon-minus-sign");
        event.target.children[0].classList.add("glyphicon-plus-sign");
        for (let i = 4; i < event.target.children.length; i++) {
          event.target.children[i].style.display = "none";
        }
      }
    } else if (event.target.className.includes("glyphicon-plus-sign")) {
      event.target.classList.remove("glyphicon-plus-sign");
      event.target.classList.add("glyphicon-minus-sign");
      for (let i = 4; i < event.target.parentNode.children.length; i++) {
        event.target.parentNode.children[i].style.display = "block";
      }
    } else if (event.target.className.includes("glyphicon-minus-sign")) {
      event.target.classList.remove("glyphicon-minus-sign");
      event.target.classList.add("glyphicon-plus-sign");
      for (let i = 4; i < event.target.parentNode.children.length; i++) {
        event.target.parentNode.children[i].style.display = "none";
      }
    } else if (event.target.className.includes("glyphicon-plus")) {
      event.target.previousElementSibling.classList.remove(
        "glyphicon-plus-sign"
      );
      event.target.previousElementSibling.classList.add("glyphicon-minus-sign");
      for (let i = 4; i < event.target.parentNode.children.length; i++) {
        event.target.parentNode.children[i].style.display = "block";
      }
      let tznewsecondorder = `<li class="papermanagesecondorder newpaper" style="display: block">
                  <span class="glyphicon glyphicon-plus-sign papermanagesecondorder" aria-hidden="true"></span>
                  <input type="text">
                  <span class="glyphicon glyphicon-remove papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-ok papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-pencil papermanagesecondorder" aria-hidden="true"></span><ul>
                  <li style="dispaly:block">月考试卷</li>
                  <li style="dispaly:block">期末测试试卷</li>
                </ul>
                </li>`;
      event.target.parentNode.innerHTML += tznewsecondorder;
    } else if (event.target.className.includes("glyphicon-minus")) {
      event.target.classList.remove("glyphicon-minus");
      event.target.classList.add("glyphicon-check");
      event.target.previousElementSibling.previousElementSibling.classList.remove(
        "glyphicon-plus-sign"
      );
      event.target.previousElementSibling.previousElementSibling.classList.add(
        "glyphicon-minus-sign"
      );
      for (let i = 4; i < event.target.parentNode.children.length; i++) {
        event.target.parentNode.children[i].style.display = "block";
        event.target.parentNode.children[i].children[1].classList.remove(
          "glyphicon-plus"
        );
        event.target.parentNode.children[i].children[1].classList.add(
          "glyphicon-remove"
        );
        event.target.parentNode.children[i].children[2].classList.remove(
          "glyphicon-minus"
        );
        event.target.parentNode.children[i].children[2].classList.add(
          "glyphicon-ok"
        );
      }
    } else if (event.target.className.includes("glyphicon-check")) {
      event.target.classList.remove("glyphicon-check");
      event.target.classList.add("glyphicon-minus");
      for (let i = 4; i < event.target.parentNode.children.length; i++) {
        event.target.parentNode.children[i].style.display = "block";
        event.target.parentNode.children[i].children[1].classList.remove(
          "glyphicon-remove"
        );
        event.target.parentNode.children[i].children[1].classList.add(
          "glyphicon-plus"
        );
        event.target.parentNode.children[i].children[2].classList.remove(
          "glyphicon-ok"
        );
        event.target.parentNode.children[i].children[2].classList.add(
          "glyphicon-minus"
        );
      }
    } else if (event.target.className.includes("glyphicon-pencil")) {
      tzpapermanagewait = event.target.parentNode.childNodes[2].textContent;
      console.log(event.target.parentNode.children[0]);
      tzstr4all = event.target.parentNode.children[0].dataset.name;
      event.target.previousElementSibling.previousElementSibling.classList.remove(
        "glyphicon-plus"
      );
      event.target.previousElementSibling.previousElementSibling.classList.add(
        "glyphicon-remove"
      );
      event.target.previousElementSibling.classList.remove("glyphicon-minus");
      event.target.previousElementSibling.classList.add("glyphicon-ok");
      for (let i = 0; i < event.target.parentNode.childNodes.length; i++) {
        if (
          event.target.parentNode.childNodes[i].nodeName == "SPAN" &&
          event.target.parentNode.childNodes[i].className.includes(
            "glyphicon-remove"
          )
        ) {
          break;
        } else {
          event.target.parentNode.removeChild(
            event.target.parentNode.childNodes[i]
          );
          i--;
        }
      }
      event.target.parentNode.innerHTML =
        ` <span class="glyphicon glyphicon-plus-sign papermanagefirstorder" aria-hidden="true" data-name="${tzstr4all}"></span>
          ${tzstr4all}<input type="text" class="tzpapermanagecount">` +
        event.target.parentNode.innerHTML;
    } else if (event.target.className.includes("glyphicon-ok")) {
      if (event.target.parentNode.children[1].value != "") {
        tzstr4all = event.target.parentNode.children[0].dataset.name;
        event.target.previousElementSibling.classList.remove(
          "glyphicon-remove"
        );
        event.target.previousElementSibling.classList.add("glyphicon-plus");
        event.target.classList.remove("glyphicon-ok");
        event.target.classList.add("glyphicon-minus");
        let str2 = event.target.parentNode.childNodes[3].value;
        event.target.parentNode.removeChild(
          event.target.parentNode.childNodes[1]
        );
        event.target.parentNode.removeChild(
          event.target.parentNode.childNodes[1]
        );
        event.target.parentNode.removeChild(
          event.target.parentNode.childNodes[1]
        );
        event.target.parentNode.innerHTML =
          ` <span class="glyphicon glyphicon-plus-sign papermanagefirstorder" aria-hidden="true" data-name="${tzstr4all}"></span>
          ${tzstr4all}(${str2})` + event.target.parentNode.innerHTML;
      }
    } else if (event.target.className.includes("glyphicon-remove")) {
      event.target.classList.remove("glyphicon-remove");
      event.target.classList.add("glyphicon-plus");
      event.target.nextElementSibling.classList.remove("glyphicon-ok");
      event.target.nextElementSibling.classList.add("glyphicon-minus");
      event.target.parentNode.removeChild(
        event.target.parentNode.childNodes[1]
      );
      event.target.parentNode.removeChild(
        event.target.parentNode.childNodes[1]
      );
      event.target.parentNode.removeChild(
        event.target.parentNode.childNodes[1]
      );
      event.target.parentNode.innerHTML =
        ` <span class="glyphicon glyphicon-plus-sign papermanagefirstorder" aria-hidden="true" data-name="${tzstr4all}"></span>${tzpapermanagewait}` +
        event.target.parentNode.innerHTML;
    }
  }
  //////////////////////////////////////////////////////////////////////////////////////////////////////////
  if (event.target.className.includes("papermanagesecondorder")) {
    if (event.target.nodeName == "LI") {
      if (event.target.children[0].className.includes("glyphicon-plus-sign")) {
        event.target.children[0].classList.remove("glyphicon-plus-sign");
        event.target.children[0].classList.add("glyphicon-minus-sign");
        for (let i = 0; i < event.target.children[4].children.length; i++) {
          event.target.children[4].children[i].style.display = "block";
        }
      } else {
        event.target.children[0].classList.remove("glyphicon-minus-sign");
        event.target.children[0].classList.add("glyphicon-plus-sign");
        for (let i = 0; i < event.target.children[4].children.length; i++) {
          event.target.children[4].children[i].style.display = "none";
        }
      }
    } else if (event.target.className.includes("glyphicon-plus-sign")) {
      event.target.classList.remove("glyphicon-plus-sign");
      event.target.classList.add("glyphicon-minus-sign");
      for (
        let i = 0;
        i < event.target.parentNode.children[4].children.length;
        i++
      ) {
        event.target.parentNode.children[4].children[i].style.display = "block";
      }
    } else if (event.target.className.includes("glyphicon-minus-sign")) {
      event.target.classList.remove("glyphicon-minus-sign");
      event.target.classList.add("glyphicon-plus-sign");
      for (
        let i = 0;
        i < event.target.parentNode.children[4].children.length;
        i++
      ) {
        event.target.parentNode.children[4].children[i].style.display = "none";
      }
    } else if (event.target.className.includes("glyphicon-remove")) {
      if (event.target.parentNode.children[1].nodeName != "INPUT") {
        event.target.parentNode.parentNode.removeChild(event.target.parentNode);
      } else {
        if (event.target.parentNode.className.includes("newpaper")) {
          event.target.parentNode.parentNode.removeChild(
            event.target.parentNode
          );
        } else {
          event.target.parentNode.innerHTML = `<span class="glyphicon glyphicon-plus-sign papermanagesecondorder" aria-hidden="true"></span>${tzpapermanagewait}
            <span class="glyphicon glyphicon-plus papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-minus papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-pencil papermanagesecondorder" aria-hidden="true"></span><ul>${event.target.parentNode.children[5].innerHTML}</ul>`;
        }
      }
    } else if (event.target.className.includes("glyphicon-ok")) {
      if (event.target.parentNode.children[1].nodeName != "INPUT") {
        event.target.classList.remove("glyphicon-ok");
        event.target.classList.add("glyphicon-minus");
        event.target.previousElementSibling.classList.remove(
          "glyphicon-remove"
        );
        event.target.previousElementSibling.classList.add("glyphicon-plus");
      } else {
        if (event.target.parentNode.children[1].value != "") {
          console.log(77777);
          let str = event.target.parentNode.children[1].value;
          console.log(event.target.parentNode.children[5]);
          let str5 = event.target.parentNode.children[5].innerHTML;
          event.target.parentNode.removeChild(
            event.target.previousElementSibling.previousElementSibling
          );
          event.target.parentNode.removeChild(
            event.target.previousElementSibling.previousElementSibling
          );
          event.target.parentNode.classList.remove("newpaper");
          event.target.parentNode.innerHTML = `<span class="glyphicon glyphicon-plus-sign papermanagesecondorder" aria-hidden="true"></span>
          ${str}
          <span class="glyphicon glyphicon-plus papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-minus papermanagesecondorder" aria-hidden="true"></span>
                  <span class="glyphicon glyphicon-pencil papermanagesecondorder" aria-hidden="true"></span><ul>${str5}</ul>`;
        }
      }
    } else if (event.target.className.includes("glyphicon-pencil")) {
      if (event.target.nextElementSibling.childNodes.length != 0) {
        for (
          let i = 0;
          i < event.target.nextElementSibling.children.length;
          i++
        ) {
          event.target.nextElementSibling.children[i].style.display = "none";
        }
      }
      tzpapermanagewait = event.target.parentNode.innerText;
      console.log(tzpapermanagewait);
      event.target.previousElementSibling.classList.remove("glyphicon-minus");
      event.target.previousElementSibling.classList.add("glyphicon-ok");
      event.target.previousElementSibling.previousElementSibling.classList.remove(
        "glyphicon-plus"
      );
      event.target.previousElementSibling.previousElementSibling.classList.add(
        "glyphicon-remove"
      );
      for (let i = 0; i < event.target.parentNode.childNodes.length; i++) {
        if (
          event.target.parentNode.childNodes[i].nodeName == "SPAN" &&
          event.target.parentNode.childNodes[i].className.includes(
            "glyphicon-remove"
          )
        ) {
          break;
        } else {
          event.target.parentNode.removeChild(
            event.target.parentNode.childNodes[i]
          );
          i--;
        }
      }
      event.target.parentNode.innerHTML =
        `<span class="glyphicon glyphicon-plus-sign papermanagesecondorder" aria-hidden="true"></span>
          <input type="text">` + event.target.parentNode.innerHTML;
    } else if (event.target.className.includes("glyphicon-plus")) {
      for (
        let i = 0;
        i < event.target.parentNode.children[4].children.length;
        i++
      ) {
        event.target.parentNode.children[4].children[i].style.display = "block";
      }
      let str6 = event.target.parentNode.children[4].innerHTML;
      event.target.parentNode.removeChild(event.target.parentNode.children[4]);
      event.target.parentNode.innerHTML += `<ul>${str6}<li style="display:block"><input type="text" class="tzpapermanageinput3">
       <span class="glyphicon glyphicon-remove papermanagethirdorder" aria-hidden="true"></span>
       <span class="glyphicon glyphicon-ok papermanagethirdorder" aria-hidden="true"></span></li></ul>`;
    } else if (event.target.className.includes("glyphicon-minus")) {
      event.target.classList.remove("glyphicon-minus");
      event.target.classList.add("glyphicon-check");
      event.target.previousElementSibling.previousElementSibling.classList.remove(
        "glyphicon-plus-sign"
      );
      event.target.previousElementSibling.previousElementSibling.classList.add(
        "glyphicon-minus-sign"
      );
      for (
        let i = 0;
        i < event.target.nextElementSibling.nextElementSibling.children.length;
        i++
      ) {
        event.target.nextElementSibling.nextElementSibling.children[
          i
        ].style.display = "block";
        let str8 =
          event.target.nextElementSibling.nextElementSibling.children[i]
            .innerText;
        event.target.nextElementSibling.nextElementSibling.children[
          i
        ].innerHTML =
          str8 +
          ` <span class="glyphicon glyphicon-remove papermanagethirdorder" aria-hidden="true"></span>
       <span class="glyphicon glyphicon-ok papermanagethirdorder" aria-hidden="true"></span>`;
      }
    } else if (event.target.className.includes("glyphicon-check")) {
      event.target.classList.remove("glyphicon-check");
      event.target.classList.add("glyphicon-minus");
      for (
        let i = 0;
        i < event.target.nextElementSibling.nextElementSibling.children.length;
        i++
      ) {
        event.target.nextElementSibling.nextElementSibling.children[
          i
        ].removeChild(
          event.target.nextElementSibling.nextElementSibling.children[i]
            .children[0]
        );
        event.target.nextElementSibling.nextElementSibling.children[
          i
        ].removeChild(
          event.target.nextElementSibling.nextElementSibling.children[i]
            .children[0]
        );
      }
    }
  }
  if (event.target.className.includes("papermanagethirdorder")) {
    if (event.target.className.includes("glyphicon-ok")) {
      if (event.target.parentNode.children[0].nodeName == "INPUT") {
        let str7 = event.target.parentNode.children[0].value;
        let tzpapermanage111 = event.target.parentNode.parentNode;
        console.log(event.target.parentNode.parentNode.innerHTML);
        event.target.parentNode.parentNode.innerHTML += `<li style="display:block">${str7}</li>`;
        tzpapermanage111.removeChild(
          tzpapermanage111.children[tzpapermanage111.children.length - 2]
        );
      } else {
        event.target.parentNode.removeChild(
          event.target.previousElementSibling
        );
        event.target.parentNode.removeChild(event.target);
      }
    } else if (event.target.className.includes("glyphicon-remove")) {
      event.target.parentNode.parentNode.removeChild(event.target.parentNode);
    }
  }
  if(event.target.className.includes("tzpapermanagefour")){
    let arr666=[];
      let str10=event.target.parentNode.parentNode.innerText.split('\n')[0].trim()
      str10=str10.substring(0,2);
      searchCon1.value = event.target.innerText.trim();
      let str11=event.target.parentNode.parentNode.parentNode.innerText;
      let str11arr=str11.split('\n');
      str11=str11arr[0].split('试');
      str11=str11[0].trim();
      searchCon1.value=str11+searchCon1.value;
      for(let i=0;i<questionListArr.length;i++){
        if(questionListArr[i].difficulty==str10 && questionListArr[i].testQuestionStem.includes(searchCon1.value)){
          arr666.push(questionListArr[i])
        }
      }
      searchCon1.value=''
      render(iNow, show, arr666);
  }
});
